/* Copyright (c) 2010 OFXKit
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import <Foundation/Foundation.h>

#import "OFXInvestmentAccount.h"
#import "OFXInvestmentTransaction.h"
#import "OFXSecurity.h"
#import "OFXInvestmentPosition.h"

typedef enum {
  TRANSFER_IN,
  TRANSFER_OUT
} OFXInvestmentTransferAction;

@interface OFXInvestmentTransfer : OFXInvestmentTransaction {
  OFXInvestmentAccount* accountFrom;
  OFXSecurity* security;
  NSNumber* units;
  NSNumber* unitPrice;
  NSDate* datePurchased;
  NSString* transferAction;
  NSString* positionType;
  NSNumber* averageCostBasis;
}

/**
 * @property accountFrom
 * @brief Sub-account that security or cash is being transferred from.
 * 
 * Valid values:
 * - CASH
 * - MARGIN
 * - SHORT
 * - OTHER
 */
@property(retain) OFXInvestmentAccount* accountFrom;

/**
 * @property security
 * @brief Underlying security 
 */
@property(retain) OFXSecurity* security;

/**
 * @property units
 * @brief Number of units in transaction
 */
@property(retain) NSNumber* units;

/**
 * @property unitPrice
 * @brief Unit price
 */
@property(retain) NSNumber* unitPrice;

/**
 * @property datePurchased
 * @brief Date security originally purchased.
 */
@property(retain) NSDate* datePurchased;

/**
 * @property transferAction
 * @brief Action for transfers: IN or OUT
 */
@property(retain) NSString* transferAction;

/**
 * @property positionType
 * @brief Position type: LONG or SHORT
 */
@property(retain) NSString* positionType;

/**
 * @property averageCostBasis
 * @brief Average cost basis
 */
@property(retain) NSNumber* averageCostBasis;

@end
